package com.leetcode.partition15;

import java.io.*;
import java.util.PriorityQueue;

/**
 * @author `RKC`
 * @date 2022/2/7 13:46
 */
public class LC1405最长快乐字符串 {

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        int a = Integer.parseInt(ss[0]), b = Integer.parseInt(ss[1]), c = Integer.parseInt(ss[2]);
        writer.write(longestDiverseString(a, b, c));
        writer.flush();
    }

    public static String longestDiverseString(int a, int b, int c) {
        StringBuilder sb = new StringBuilder();
        PriorityQueue<int[]> heap = new PriorityQueue<>(3, (o1, o2) -> Integer.compare(o2[1], o1[1]));
        if (a > 0) heap.add(new int[]{'a', a});
        if (b > 0) heap.add(new int[]{'b', b});
        if (c > 0) heap.add(new int[]{'c', c});
        while (!heap.isEmpty()) {
            int[] cur = heap.poll();
            int n = sb.length();
            if (n >= 2 && sb.charAt(n - 1) == cur[0] && sb.charAt(n - 2) == cur[0]) {
                //取出次大的值拼接上去
                if (heap.isEmpty()) break;
                int[] ne = heap.poll();
                sb.append((char) ne[0]);
                if (ne[1] - 1 > 0) heap.add(new int[]{ne[0], ne[1] - 1});
                heap.add(cur);
            } else {
                sb.append((char) cur[0]);
                if (cur[1] - 1 > 0) heap.add(new int[]{cur[0], cur[1] - 1});
            }
        }
        return sb.toString();
    }
}
